<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path =request.getContextPath();%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑菜谱:爱下厨</title>
<meta name="renderer" content="webkit">
<meta name="keywords" content="">
<meta name="description" content="" />
<link rel="shortcut icon" href="https://static.meishichina.com/v6/img/lib/f.ico"/>
<link rel="apple-touch-icon" href="https://static.meishichina.com/v6/img/lib/wapico.png" />
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/lib/all.css?v1=13">
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/app/center/all.css?v1=2017-08-17">
<link rel="stylesheet" href="https://static.meishichina.com/v6/css/app/center/center_recipe3.css?v1=20200430">
<!-- ***************************    导入弹窗样式   ************************************ -->
<link rel="stylesheet" type="text/css" href="https://www.huangwx.cn/css/sweetalert.css">
<script type="text/javascript" src="https://www.huangwx.cn/js/sweetalert-dev.js"></script>
<style>
.picsize{background:rgba(0,0,0,.7);right:3px;padding:7px;position:absolute;bottom:3px;z-index:111;border-radius:15px;line-height:60%;color:#fff;z-index:111}
.picsizes{background: rgba(255,66,66,.7)}
.picw{background:rgba(0,0,0,.7);color:#fff;cursor:default;font-size:12px;line-height:60%;padding:7px;position:absolute;right:3px;bottom:3px;text-decoration:none;border-radius:15px}
.picws{background:rgba(255,66,66,.7)}
.picw:hover{color:#fff;text-decoration:none}
.showpic{padding:5px;background:rgba(0,0,0,.7);color:#fff;font-size:12px;line-height:60%;padding:7px;position:absolute;left:3px;bottom:3px;border-radius:15px;}
.showpic:hover{color:#fff}
.makedifficulty{display: inline-block;margin-right: 20px}
.needtime{display: inline-block}
.need_time span,.difficulty span{width: 40px;text-align: center}
</style>
</head>

<body>
<!-- 主框架 -->
<div class="w_main clear">
<!-- 右侧 -->
<div class="mod_right">
<div class="mr_edit mr_edit_center clear">
		<!-- 导入在线编辑器js文件 -->
		<!-- 在线编辑器的整个代码 -->
		<script src="<%=path %>/front/ueditor2/ueditor.config.js"></script>
		<script src="<%=path %>/front/ueditor2/ueditor.all.js"></script>
		<script src="<%=path %>/front/ueditor2/lang/zh-cn/zh-cn.js"></script>
		<script src="<%=path %>/front/js/jquery-3.5.0.min.js"></script>


		                       <!-- form表单开始 -->
<form method="post"  id="myform" action="<%=path%>/DiaryServlet?action=upDiary">          
			<ul>
			<li>
			<label class="must">日志标题</label><br>
			<input name="diaryName" class="inputL" type="text" id="diaryName" placeholder="请输入日志的标题名称">
			</li>
			<li  class="options clear">			
			<div class="options_box clear">		
			<li class="step">
			<label class="must">日志内容</label><br>
			<div id="dragsort">
			<blockquote class="cp_block J_blockQ clear"  data-gif="0" data-id="7859470">
			
			
			                 <!----------------------------------- 在线编辑器的地方 ------------------------------->
			<textarea id="content" name="diaryContent" placeholder="请输入内容" ></textarea>		
			</blockquote>			
			 </div>			
			</li>			
			</ul>

</div>
<!-- -----------------------//在线编辑器结束 -->

			<!-- 发布菜谱和存草稿右侧滑动栏 -->
			<div class="mr_edit mr_edit_fixed clear">
			<input class="btn1" id="upbtn" type="submit" value="发布菜谱" >
			<a href="<%=path%>/IndexServlet"><input class="btn1" id="upbtn" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回首页" ></a>
			</div>
			
			</form>  
			 <!-- ----------------------------------表单的提交事件 ----------------------------->
<script type="text/javascript">
$(function(){
	<%String action=request.getParameter("action"); %>
	<%if("s".equals(action)){%>
		swal("上传成功，等待管理员审核日志内容！");
	<% 	
	} %>
		
});


//将文本域替换成在线编辑器 cookStep就是发送给servlet的内容
   var editor;
	$(function(){
		var items ={
				initialFrameWidth:1000,
				initialFrameHeight:400,
				toolbars:[['bold', 'horizontal',  'underline','source','fontfamily', 'fontsize', 'emotion' ,'spechars','background' ],['simpleupload',]]		
		};
		editor=UE.getEditor("content",items);
		//有返回值 返回的就是在线编辑器
	});
	
	$(function(){
		$("#myform").submit(function(){
			//获得在线编辑器中间的内容  editor是在线编辑器对象
			var content = editor.getContent();
			var diaryName = $("#diaryName").val();
			if(content==""||diaryName=="")
			{
				swal("请完善日志标题和内容！~");
				return false;	
			}
		});//事件结束
	})//结束
</script>			 
			</div><!-- 右侧结束 -->
			</div>

<!-- **********************************8 -->


<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript">
msc.user.init();
$("img.imgLoad").imgLoad();
</script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/jquery.dragsort.js"></script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/autosize.js"></script>


<script type="text/javascript" src="//static.meishichina.com/v6/js/app/center/center_recipe1.js?v1=20200316"></script>

<script>
$("li.top_bar_more").hoverDelay(function(){$("li.top_bar_more div").show()},function(){$("li.top_bar_more div").hide()},200,200);var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="//hm.baidu.com/hm.js?fb9cd9dcdda23cee0c7357db9be24acb";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();
</script>
</body>
</html>

